package net.opslog.web.client;


import net.opslog.web.client.resources.AppResources;
import net.opslog.web.client.util.Properties;
import net.opslog.web.client.views.MainView;
import net.opslog.web.client.views.MainViewImpl;

import com.google.gwt.event.shared.SimpleEventBus;
import com.google.gwt.place.shared.PlaceController;
import com.google.web.bindery.event.shared.EventBus;

public class ClientFactoryImpl implements ClientFactory {
	private final EventBus eventBus = new SimpleEventBus();
	private final PlaceController placeController = new PlaceController(
			eventBus);
	private final MainView mainView = new MainViewImpl();
	private Properties properties = new Properties();

	private ClientFactoryImpl() {

		properties.load(AppResources.INSTANCE.initialConfiguration().getText());
	}

	@Override
	public EventBus getEventBus() {
		return eventBus;
	}

	@Override
	public PlaceController getPlaceController() {
		return placeController;
	}

	@Override
	public MainView getMainView() {
		return mainView;
	}

	@Override
	public Properties getConfiguration() {
		return properties;
	}

}
